package control

import (
	"admin/src/log"
	"admin/src/res"
	"admin/src/utils"
	"github.com/gin-gonic/gin"
)

func GetPublicKey(c *gin.Context) {
	key, err := utils.LoadPublicKey("key/public.pem")
	if err != nil {
		log.Logger.Error("读取公钥失败" + err.Error())
		res.FadedMsg(c, "读取公钥失败"+err.Error())
		return
	} else {
		res.Ok(c, key)
	}
}
